//
//  BaseTicket.m
//  NetTest
//
//  Created by mac on 12-5-14.
//  Copyright (c) 2012年 __MyCompanyName__. All rights reserved.
//

#import "BaseTicket.h"

@implementation BaseTicket

-(id)init{
    return [super init];
}

-(void)dealloc{
    if (printArray!=nil){
        [printArray removeAllObjects];
        [printArray release];
        printArray = nil;
    }
    [super dealloc];
}

@end

#pragma mark ForecastTick
@implementation ForecastTick

@synthesize group,tick;
@synthesize spanCount;

-(void)setTick:(TicketResult *)tick_{
    tick=[tick_ retain];
    NSArray *arr = [tick.result componentsSeparatedByString:@" "];
    
    if (arr!=nil&&[arr count]>0) {
        int sum=0;
        for (NSString *substr in arr) {
            NSLog(@" %@",substr);
            sum +=[substr intValue];
        }
        
        NSLog(@" sum %i",sum);
    }
}


-(void)printLog{
    NSMutableArray *group1=(NSMutableArray *)[group objectAtIndex:0];
    NSMutableArray *group2=(NSMutableArray *)[group objectAtIndex:1];

    NSLog(@" %@ %@ - %@ %@  期号:%@ 号码:%@ 总共:%i",[group1 objectAtIndex:0],[group1 objectAtIndex:1],[group2 objectAtIndex:0],[group2 objectAtIndex:1], tick.sectionID,tick.result,spanCount);
}

-(void)dealloc{
    if (group!=nil) {
        [group removeAllObjects];
        [group release];
        group = nil;
    }
    [tick release];
    [super dealloc];
}

@end